/*
 * @Author: maoyu
 * @Date: 2021-05-25 10:24:53
 * @LastEditTime: 2021-07-01 11:16:55
 * @LastEditors: zzp
 * @Description: 电子校务-工作流-接口
 */

import request from '@/utils/request'

const PRE_CODE = '/sys/affairsWorkflow'
const APPLY_PRE_CODE = '/sys/affairsApplyWorkflow'



export default {
    // 流程配置
  getTableListWorkflow(params) {
    return request({
      url: `${PRE_CODE}/getTableList`,
      method: 'get',
      params
    })
  },

  // 流程配置查看
  getWorkflowInfo(params) {
    return request({
      url: `${PRE_CODE}/info`,
      method: 'get',
      params
    })
  },

  // 新增流程
  saveWorkflow(data) {
    return request({
      url: `${PRE_CODE}/save`,
      method: 'post',
      data
    })
  },
  // 删除流程
  deleteWorkflow(data) {
    return request({
      url: `${PRE_CODE}/delete`,
      method: 'post',
      data
    })
  },

  // 流程配置
  getListWorkflow(params) {
    return request({
      url: `${PRE_CODE}/getList`,
      method: 'get',
      params
    })
  },

  // 申请列表
  getTableListWorkflowApply(params) {
    return request({
      url: `${APPLY_PRE_CODE}/getApplyList`,
      method: 'get',
      params
    })
  },

  // 申请查看
  getWorkflowApplyInfo(params) {
    return request({
      url: `${APPLY_PRE_CODE}/info`,
      method: 'get',
      params
    })
  },

  // 新增申请
  applyWorkflowApply(data) {
    return request({
      url: `${APPLY_PRE_CODE}/apply`,
      method: 'post',
      data
    })
  },
  // 删除申请
  cancelWorkflowApply(params) {
    return request({
      url: `${APPLY_PRE_CODE}/cancel`,
      method: 'get',
      params
    })
  },
  // 审批列表
  getExamineListWorkflow(params) {
    return request({
      url: `${APPLY_PRE_CODE}/getExamineList`,
      method: 'get',
      params
    })
  },

  // 多个审批
  multipleExamineWorkflow(data) {
    return request({
      url: `${APPLY_PRE_CODE}/multipleExamine`,
      method: 'post',
      data
    })
  },

  // 审批
  examineWorkflow(data) {
    return request({
      url: `${APPLY_PRE_CODE}/examine`,
      method: 'post',
      data
    })
  },
  getWorkflowType() {
    return request({
      url: `${PRE_CODE}/getWorkflowType`,
      method: 'get'
    })
  },
  getCompanyApplyList(companyId){
    return request({
      url: `${APPLY_PRE_CODE}/getCompanyApplyList/${companyId}`,
      method: 'get'
    })
  },
  getProjectApplyList(){
    return request({
      url: `${APPLY_PRE_CODE}/getProjectApplyList`,
      method: 'get'
    })
  },
  getWorkflowId(workflowType) {
    return request({
      url: `${PRE_CODE}/getWorkFlowIdByWorkType/${workflowType}`,
      method: 'get'
    })
  },
  getWorkflowList(workflowType) {
    return request({
      url: `${PRE_CODE}/getWorkflowList/${workflowType}`,
      method: 'get'
    })
  }

}
